#include <stdio.h>
#include <unistd.h>

int g_val = 100;

int main()
{
    pid_t pid  = fork();
    if(pid < 0)
    {
        perror("fork");
        return 0;
    }
    else if(pid == 0)
    {
        //child
        //g_val = 10;
        printf("i am child:%d-%p\n", g_val, &g_val);
    }
    else
    {
        //parent
        printf("i am parent:%d-%p\n", g_val, &g_val);
    }
    return 0;
}
